#include "BatteryComponent.h"

void BatteryComponent::setBatteryStatus(BatteryStatus status)
{
	switch (status)
	{
		case BATTERY_EMPTY:
			this->batteryStatusFile = BATTERY_1;
			break;
		case BATTERY_LOW:
			this->batteryStatusFile = BATTERY_2;
			break;
		case BATTERY_NORMAL:
			this->batteryStatusFile = BATTERY_3;
			break;
		case BATTERY_HIGH:
			this->batteryStatusFile = BATTERY_4;
			break;
		default:
			break;
	}
}

void BatteryComponent::doRender()
{
	string path = NAVI_ICON_FILE(batteryStatusFile);
	lcd.drawBmpFile(SD, path.c_str(), BATTERY_POS_X, BATTERY_POS_Y);
}

BatteryComponent::BatteryComponent() : ViewComponent(false)
{
	this->setBatteryStatus(BATTERY_HIGH);
}


BatteryComponent::~BatteryComponent()
{
}
